#include <iostream>
using namespace std;


string s;

bool isp(char l, char r) {
    return l=='(' && r==')'
        || l=='[' && r==']'
        || l=='<' && r=='>'
        || l=='{' && r=='}';
}
int lv(char c) {
    return (c=='(' || c=='[' || c=='{' || c=='<') ? -1 : 1;
    }


int mp(char c, int i, int l)
{
    return i<0 || l==0 && isp(s[i], c) ? i : mp(c, i-1, l+lv(s[i]));
}


bool f(int b, int e)
{
    int c = mp(s[e], e, -1);
    return b>e || c>=b && f(b, c-1) && f(c+1, e-1);
}


int main()
{
     cin >> s; cout << (f(0, s.length()-1) ? "yes" : "no");
     }
